package com.proj.service.impl;

import com.proj.bean.User;
import com.proj.dao.UserDao;
import com.proj.service.IShoppingLoginService;
import com.proj.util.SYS;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ShoppingLoginService implements IShoppingLoginService {

    @Autowired
    UserDao userDao;

    @Override
    public User dologin(User user) {
        User user_data=userDao.getUserByUsername(user.getName());
        if(user_data!=null&& SYS.checkPass(user.getPassword(),user_data.getPassword())){
            return user_data;
        }
        return null;
    }

}
